Add check_deps rules in DEPS files.

Add fine-grained check_deps rules for all of WebRTC.
This will help both maintaining sane dependencies and provides a way
to visualize dependency graphs using the buildtools/checkdeps/graphdeps.py script.

Example:
buildtools/checkdeps/graphdeps.py --root=. --format=png \
--out=./webrtc.png --incl='^webrtc/modules/bitrate_controller->' \
--excl='chromium|base|external|testing|webrtc/test|\.h$|\.cc$'

will produce a neat webrtc.png image showcasing the dependencies
(according to the DEPS file) for the bitrate_controller module.
Some dependencies are filtered out for readability.

BUG=webrtc:5623
TESTED=Passing runs using:
buildtools/checkdeps/checkdeps.py --root=. talk
buildtools/checkdeps/checkdeps.py --root=. webrtc

R=tommi@webrtc.org

Review URL: https://codereview.webrtc.org/1796413002 .

Cr-Commit-Position: refs/heads/master@{#12008}
diff --git a/DEPS b/DEPS
index 1ec0583..7f2225c 100644
--- a/DEPS
+++ b/DEPS
@@ -23,25 +23,6 @@
   },
 }
 
-# Define rules for which include paths are allowed in our source.
-include_rules = [
-  # Base is only used to build Android APK tests and may not be referenced by
-  # WebRTC production code.
-  '-base',
-  '-chromium',
-  '+external/webrtc/webrtc',  # Android platform build.
-  '+gflags',
-  '+libyuv',
-  '+net',
-  '+talk',
-  '+testing',
-  '+third_party',
-  '+unicode',
-  '+usrsctplib',
-  '+webrtc',
-  '+vpx',
-]
-
 hooks = [
   {
     # Check for legacy named top-level dir (named 'trunk').
diff --git a/talk/app/webrtc/DEPS b/talk/app/webrtc/DEPS
new file mode 100644
index 0000000..69ecd02
--- /dev/null
+++ b/talk/app/webrtc/DEPS
@@ -0,0 +1,7 @@
+include_rules = [
+  "+talk/app/webrtc/objc",
+  "+webrtc/video_frame.h",
+  "+webrtc/api",
+  "+webrtc/base",
+  "+webrtc/media",
+]
diff --git a/webrtc/DEPS b/webrtc/DEPS
new file mode 100644
index 0000000..292c996
--- /dev/null
+++ b/webrtc/DEPS
@@ -0,0 +1,47 @@
+# Define rules for which include paths are allowed in our source.
+include_rules = [
+  # Base is only used to build Android APK tests and may not be referenced by
+  # WebRTC production code.
+  "-base",
+  "-chromium",
+  "+external/webrtc/webrtc",  # Android platform build.
+  "+gflags",
+  "+libyuv",
+  "+testing",
+  "-webrtc",  # Has to be disabled; otherwise all dirs below will be allowed.
+  # Individual headers that will be moved out of here, see webrtc:
+  "+webrtc/audio_receive_stream.h",
+  "+webrtc/audio_send_stream.h",
+  "+webrtc/audio_sink.h",
+  "+webrtc/audio_state.h",
+  "+webrtc/call.h",
+  "+webrtc/common.h",
+  "+webrtc/common_types.h",
+  "+webrtc/config.h",
+  "+webrtc/engine_configurations.h",
+  "+webrtc/frame_callback.h",
+  "+webrtc/stream.h",
+  "+webrtc/transport.h",
+  "+webrtc/typedefs.h",
+  "+webrtc/video_decoder.h",
+  "+webrtc/video_encoder.h",
+  "+webrtc/video_frame.h",
+  "+webrtc/video_receive_stream.h",
+  "+webrtc/video_renderer.h",
+  "+webrtc/video_send_stream.h",
+
+  "+webrtc/base",
+  "+webrtc/modules/include",
+  "+webrtc/test",
+  "+webrtc/tools",
+]
+
+# The below rules will be removed when webrtc: is fixed.
+specific_include_rules = {
+  "audio_send_stream\.h": [
+    "+webrtc/modules/audio_coding",
+  ],
+  "video_frame\.h": [
+    "+webrtc/common_video",
+  ],
+}
diff --git a/webrtc/api/DEPS b/webrtc/api/DEPS
new file mode 100644
index 0000000..956d4d9
--- /dev/null
+++ b/webrtc/api/DEPS
@@ -0,0 +1,23 @@
+include_rules = [
+  "+third_party/libyuv",
+  "+webrtc/base",
+  "+webrtc/common_video",
+  "+webrtc/media",
+  "+webrtc/p2p",
+  "+webrtc/pc",
+  "+webrtc/modules/audio_device",
+  "+webrtc/modules/rtp_rtcp",
+  "+webrtc/modules/video_coding",
+  "+webrtc/modules/video_render",
+  "+webrtc/system_wrappers",
+]
+
+specific_include_rules = {
+  "androidtestinitializer\.cc": [
+    "+base/android",  # Allowed only for Android tests.
+    "+webrtc/voice_engine",
+  ],
+  "peerconnection_jni\.cc": [
+    "+webrtc/voice_engine",
+  ]
+}
diff --git a/webrtc/audio/DEPS b/webrtc/audio/DEPS
new file mode 100644
index 0000000..63711ab
--- /dev/null
+++ b/webrtc/audio/DEPS
@@ -0,0 +1,10 @@
+include_rules = [
+  "+webrtc/base",
+  "+webrtc/voice_engine",
+  "+webrtc/modules/bitrate_controller",
+  "+webrtc/modules/congestion_controller",
+  "+webrtc/modules/pacing",
+  "+webrtc/modules/remote_bitrate_estimator",
+  "+webrtc/modules/rtp_rtcp",
+  "+webrtc/system_wrappers",
+]
diff --git a/webrtc/base/DEPS b/webrtc/base/DEPS
new file mode 100644
index 0000000..add7f38
--- /dev/null
+++ b/webrtc/base/DEPS
@@ -0,0 +1,11 @@
+include_rules = [
+  "+json",
+  "+third_party/jsoncpp",
+  "+webrtc/system_wrappers",
+]
+
+specific_include_rules = {
+  "gunit_prod.h": [
+    "+gtest",
+  ],
+}
diff --git a/webrtc/call/DEPS b/webrtc/call/DEPS
new file mode 100644
index 0000000..0f90308
--- /dev/null
+++ b/webrtc/call/DEPS
@@ -0,0 +1,13 @@
+include_rules = [
+  "+webrtc/audio",
+  "+webrtc/base",
+  "+webrtc/modules/audio_coding",
+  "+webrtc/modules/bitrate_controller",
+  "+webrtc/modules/congestion_controller",
+  "+webrtc/modules/pacing",
+  "+webrtc/modules/rtp_rtcp",
+  "+webrtc/modules/utility",
+  "+webrtc/system_wrappers",
+  "+webrtc/voice_engine",
+  "+webrtc/video",
+]
diff --git a/webrtc/common_audio/DEPS b/webrtc/common_audio/DEPS
new file mode 100644
index 0000000..2d21857
--- /dev/null
+++ b/webrtc/common_audio/DEPS
@@ -0,0 +1,5 @@
+include_rules = [
+  "+third_party/openmax_dl",
+  "+webrtc/base",
+  "+webrtc/system_wrappers",
+]
diff --git a/webrtc/common_audio/real_fourier_openmax.cc b/webrtc/common_audio/real_fourier_openmax.cc
index bc3e734..e560b6c 100644
--- a/webrtc/common_audio/real_fourier_openmax.cc
+++ b/webrtc/common_audio/real_fourier_openmax.cc
@@ -12,7 +12,7 @@
 
 #include <cstdlib>
 
-#include "dl/sp/api/omxSP.h"
+#include "third_party/openmax_dl/dl/sp/api/omxSP.h"
 #include "webrtc/base/checks.h"
 
 namespace webrtc {
diff --git a/webrtc/common_video/DEPS b/webrtc/common_video/DEPS
new file mode 100644
index 0000000..2805958
--- /dev/null
+++ b/webrtc/common_video/DEPS
@@ -0,0 +1,4 @@
+include_rules = [
+  "+webrtc/base",
+  "+webrtc/system_wrappers",
+]
diff --git a/webrtc/examples/DEPS b/webrtc/examples/DEPS
new file mode 100644
index 0000000..a562df9
--- /dev/null
+++ b/webrtc/examples/DEPS
@@ -0,0 +1,7 @@
+include_rules = [
+  "+webrtc/api",
+  "+webrtc/base",
+  "+webrtc/media",
+  "+webrtc/modules/audio_device",
+  "+webrtc/p2p",
+]
diff --git a/webrtc/libjingle/DEPS b/webrtc/libjingle/DEPS
new file mode 100644
index 0000000..7f49277
--- /dev/null
+++ b/webrtc/libjingle/DEPS
@@ -0,0 +1,5 @@
+include_rules = [
+  "+third_party/expat",
+  "+webrtc/base",
+  "+webrtc/p2p",
+]
diff --git a/webrtc/libjingle/xmpp/chatroommodule_unittest.cc b/webrtc/libjingle/xmpp/chatroommodule_unittest.cc
deleted file mode 100644
index 65d2827..0000000
--- a/webrtc/libjingle/xmpp/chatroommodule_unittest.cc
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- *  Copyright 2004 The WebRTC Project Authors. All rights reserved.
- *
- *  Use of this source code is governed by a BSD-style license
- *  that can be found in the LICENSE file in the root of the source
- *  tree. An additional intellectual property rights grant can be found
- *  in the file PATENTS.  All contributing project authors may
- *  be found in the AUTHORS file in the root of the source tree.
- */
-
-#include <iostream>
-#include <sstream>
-#include <string>
-#include "buzz/chatroommodule.h"
-#include "buzz/constants.h"
-#include "buzz/xmlelement.h"
-#include "buzz/xmppengine.h"
-#include "common/common.h"
-#include "engine/util_unittest.h"
-#include "test/unittest-inl.h"
-#include "test/unittest.h"
-
-#define TEST_OK(x) TEST_EQ((x),XMPP_RETURN_OK)
-#define TEST_BADARGUMENT(x) TEST_EQ((x),XMPP_RETURN_BADARGUMENT)
-
-namespace buzz {
-
-class MultiUserChatModuleTest;
-
-static void
-WriteEnteredStatus(std::ostream& os, XmppChatroomEnteredStatus status) {
-  switch(status) {
-    case XMPP_CHATROOM_ENTERED_SUCCESS:
-      os<<"success";
-      break;
-    case XMPP_CHATROOM_ENTERED_FAILURE_NICKNAME_CONFLICT:
-      os<<"failure(nickname conflict)";
-      break;
-    case XMPP_CHATROOM_ENTERED_FAILURE_PASSWORD_REQUIRED:
-      os<<"failure(password required)";
-      break;
-    case XMPP_CHATROOM_ENTERED_FAILURE_PASSWORD_INCORRECT:
-      os<<"failure(password incorrect)";
-      break;
-    case XMPP_CHATROOM_ENTERED_FAILURE_NOT_A_MEMBER:
-      os<<"failure(not a member)";
-      break;
-    case XMPP_CHATROOM_ENTERED_FAILURE_MEMBER_BANNED:
-      os<<"failure(member banned)";
-      break;
-    case XMPP_CHATROOM_ENTERED_FAILURE_MAX_USERS:
-      os<<"failure(max users)";
-      break;
-    case XMPP_CHATROOM_ENTERED_FAILURE_ROOM_LOCKED:
-      os<<"failure(room locked)";
-      break;
-    case XMPP_CHATROOM_ENTERED_FAILURE_UNSPECIFIED:
-      os<<"failure(unspecified)";
-      break;
-    default:
-      os<<"unknown";
-      break;
-  } 
-}
-
-static void
-WriteExitedStatus(std::ostream& os, XmppChatroomExitedStatus status) {
-  switch (status) {
-    case XMPP_CHATROOM_EXITED_REQUESTED:
-      os<<"requested";
-      break;
-    case XMPP_CHATROOM_EXITED_BANNED:
-      os<<"banned";
-      break;
-    case XMPP_CHATROOM_EXITED_KICKED:
-      os<<"kicked";
-      break;
-    case XMPP_CHATROOM_EXITED_NOT_A_MEMBER:
-      os<<"not member";
-      break;
-    case XMPP_CHATROOM_EXITED_SYSTEM_SHUTDOWN:
-      os<<"system shutdown";
-      break;
-    case XMPP_CHATROOM_EXITED_UNSPECIFIED:
-      os<<"unspecified";
-      break;
-    default:
-      os<<"unknown";
-      break;
-  }
-}
-
-//! This session handler saves all calls to a string.  These are events and
-//! data delivered form the engine to application code.
-class XmppTestChatroomHandler : public XmppChatroomHandler {
-public:
-  XmppTestChatroomHandler() {}
-  virtual ~XmppTestChatroomHandler() {}
-
-  void ChatroomEnteredStatus(XmppChatroomModule* room,
-                             XmppChatroomEnteredStatus status) {
-    RTC_UNUSED(room);
-    ss_ <<"[ChatroomEnteredStatus status: ";
-    WriteEnteredStatus(ss_, status);
-    ss_ <<"]";
-  }
-
-
-  void ChatroomExitedStatus(XmppChatroomModule* room,
-                            XmppChatroomExitedStatus status) {
-    RTC_UNUSED(room);
-    ss_ <<"[ChatroomExitedStatus status: ";
-    WriteExitedStatus(ss_, status);
-    ss_ <<"]";
-  }
-
-  void MemberEntered(XmppChatroomModule* room, 
-                          const XmppChatroomMember* entered_member) {
-    RTC_UNUSED(room);
-    ss_ << "[MemberEntered " << entered_member->member_jid().Str() << "]";
-  }
-
-  void MemberExited(XmppChatroomModule* room,
-                         const XmppChatroomMember* exited_member) {
-    RTC_UNUSED(room);
-    ss_ << "[MemberExited " << exited_member->member_jid().Str() << "]";
-  }
-
-  void MemberChanged(XmppChatroomModule* room,
-      const XmppChatroomMember* changed_member) {
-    RTC_UNUSED(room);
-    ss_ << "[MemberChanged " << changed_member->member_jid().Str() << "]";
-  }
-
-  virtual void MessageReceived(XmppChatroomModule* room, const XmlElement& message) {
-    RTC_UNUSED2(room, message);
-  }
-
- 
-  std::string Str() {
-    return ss_.str();
-  }
-
-  std::string StrClear() {
-    std::string result = ss_.str();
-    ss_.str("");
-    return result;
-  }
-
-private:
-  std::stringstream ss_;
-};
-
-//! This is the class that holds all of the unit test code for the
-//! roster module
-class XmppChatroomModuleTest : public UnitTest {
-public:
-  XmppChatroomModuleTest() {}
-
-  void TestEnterExitChatroom() {
-    std::stringstream dump;
-
-    // Configure the engine
-    rtc::scoped_ptr<XmppEngine> engine(XmppEngine::Create());
-    XmppTestHandler handler(engine.get());
-
-    // Configure the module and handler
-    rtc::scoped_ptr<XmppChatroomModule> chatroom(XmppChatroomModule::Create());
-
-    // Configure the module handler
-    chatroom->RegisterEngine(engine.get());
-
-    // Set up callbacks
-    engine->SetOutputHandler(&handler);
-    engine->AddStanzaHandler(&handler);
-    engine->SetSessionHandler(&handler);
-
-    // Set up minimal login info
-    engine->SetUser(Jid("david@my-server"));
-    engine->SetPassword("david");
-
-    // Do the whole login handshake
-    RunLogin(this, engine.get(), &handler);
-    TEST_EQ("", handler.OutputActivity());
-
-    // Get the chatroom and set the handler
-    XmppTestChatroomHandler chatroom_handler;
-    chatroom->set_chatroom_handler(static_cast<XmppChatroomHandler*>(&chatroom_handler));
-
-    // try to enter the chatroom
-    TEST_EQ(chatroom->state(), XMPP_CHATROOM_STATE_NOT_IN_ROOM);
-    chatroom->set_nickname("thirdwitch");
-    chatroom->set_chatroom_jid(Jid("darkcave@my-server"));
-    chatroom->RequestEnterChatroom("", XMPP_CONNECTION_STATUS_UNKNOWN, "en");
-    TEST_EQ(chatroom_handler.StrClear(), "");
-    TEST_EQ(handler.OutputActivity(),
-      "<presence to=\"darkcave@my-server/thirdwitch\">"
-        "<muc:x xmlns:muc=\"http://jabber.org/protocol/muc\"/>"
-      "</presence>");
-    TEST_EQ(chatroom->state(), XMPP_CHATROOM_STATE_REQUESTED_ENTER);
-
-    // simulate the server and test the client
-    std::string input;
-    input = "<presence from=\"darkcave@my-server/firstwitch\" to=\"david@my-server\">"
-             "<x xmlns=\"http://jabber.org/protocol/muc#user\">"
-              "<item affiliation=\"owner\" role=\"participant\"/>"
-             "</x>"
-            "</presence>";
-    TEST_OK(engine->HandleInput(input.c_str(), input.length()));
-    TEST_EQ(chatroom_handler.StrClear(), "");
-    TEST_EQ(chatroom->state(), XMPP_CHATROOM_STATE_REQUESTED_ENTER);
-
-    input = "<presence from=\"darkcave@my-server/secondwitch\" to=\"david@my-server\">"
-             "<x xmlns=\"http://jabber.org/protocol/muc#user\">"
-              "<item affiliation=\"member\" role=\"participant\"/>"
-             "</x>"
-            "</presence>";
-    TEST_OK(engine->HandleInput(input.c_str(), input.length()));
-    TEST_EQ(chatroom_handler.StrClear(), "");
-    TEST_EQ(chatroom->state(), XMPP_CHATROOM_STATE_REQUESTED_ENTER);
-
-    input = "<presence from=\"darkcave@my-server/thirdwitch\" to=\"david@my-server\">"
-             "<x xmlns=\"http://jabber.org/protocol/muc#user\">"
-              "<item affiliation=\"member\" role=\"participant\"/>"
-             "</x>"
-            "</presence>";
-    TEST_OK(engine->HandleInput(input.c_str(), input.length()));
-    TEST_EQ(chatroom_handler.StrClear(),
-      "[ChatroomEnteredStatus status: success]");
-    TEST_EQ(chatroom->state(), XMPP_CHATROOM_STATE_IN_ROOM);
-
-    // simulate somebody else entering the room after we entered
-    input = "<presence from=\"darkcave@my-server/fourthwitch\" to=\"david@my-server\">"
-             "<x xmlns=\"http://jabber.org/protocol/muc#user\">"
-              "<item affiliation=\"member\" role=\"participant\"/>"
-             "</x>"
-            "</presence>";
-    TEST_OK(engine->HandleInput(input.c_str(), input.length()));
-    TEST_EQ(chatroom_handler.StrClear(), "[MemberEntered darkcave@my-server/fourthwitch]");
-    TEST_EQ(chatroom->state(), XMPP_CHATROOM_STATE_IN_ROOM);
-
-    // simulate somebody else leaving the room after we entered
-    input = "<presence from=\"darkcave@my-server/secondwitch\" to=\"david@my-server\" type=\"unavailable\">"
-             "<x xmlns=\"http://jabber.org/protocol/muc#user\">"
-              "<item affiliation=\"member\" role=\"participant\"/>"
-             "</x>"
-            "</presence>";
-    TEST_OK(engine->HandleInput(input.c_str(), input.length()));
-    TEST_EQ(chatroom_handler.StrClear(), "[MemberExited darkcave@my-server/secondwitch]");
-    TEST_EQ(chatroom->state(), XMPP_CHATROOM_STATE_IN_ROOM);
-
-    // try to leave the room
-    chatroom->RequestExitChatroom();
-    TEST_EQ(chatroom_handler.StrClear(), "");
-    TEST_EQ(handler.OutputActivity(),
-      "<presence to=\"darkcave@my-server/thirdwitch\" type=\"unavailable\"/>");
-    TEST_EQ(chatroom->state(), XMPP_CHATROOM_STATE_REQUESTED_EXIT);
-
-    // simulate the server and test the client
-    input = "<presence from=\"darkcave@my-server/thirdwitch\" to=\"david@my-server\" type=\"unavailable\">"
-             "<x xmlns=\"http://jabber.org/protocol/muc#user\">"
-              "<item affiliation=\"member\" role=\"participant\"/>"
-             "</x>"
-            "</presence>";
-    TEST_OK(engine->HandleInput(input.c_str(), input.length()));
-    TEST_EQ(chatroom_handler.StrClear(),
-      "[ChatroomExitedStatus status: requested]");
-    TEST_EQ(chatroom->state(), XMPP_CHATROOM_STATE_NOT_IN_ROOM);
-  }
-
-};
-
-// A global function that creates the test suite for this set of tests.
-TestBase* ChatroomModuleTest_Create() {
-  TestSuite* suite = new TestSuite("ChatroomModuleTest");
-  ADD_TEST(suite, XmppChatroomModuleTest, TestEnterExitChatroom);
-  return suite;
-}
-
-}
diff --git a/webrtc/media/DEPS b/webrtc/media/DEPS
new file mode 100644
index 0000000..10f88d0
--- /dev/null
+++ b/webrtc/media/DEPS
@@ -0,0 +1,22 @@
+include_rules = [
+  "+webrtc/base",
+  "+webrtc/call",
+  "+webrtc/common_video",
+  "+webrtc/modules/audio_coding",
+  "+webrtc/modules/audio_device",
+  "+webrtc/modules/audio_processing",
+  "+webrtc/modules/video_capture",
+  "+webrtc/modules/video_coding",
+  "+webrtc/p2p",
+  "+webrtc/pc",
+  "+webrtc/sound",
+  "+webrtc/system_wrappers",
+  "+webrtc/voice_engine",
+  "+usrsctplib",
+]
+
+specific_include_rules = {
+  "win32devicemanager\.cc": [
+    "+third_party/logitech/files/logitechquickcam.h",
+  ],
+}
diff --git a/webrtc/modules/audio_coding/DEPS b/webrtc/modules/audio_coding/DEPS
new file mode 100644
index 0000000..31aa1c2
--- /dev/null
+++ b/webrtc/modules/audio_coding/DEPS
@@ -0,0 +1,7 @@
+include_rules = [
+  "+webrtc/base",
+  "+webrtc/call",
+  "+webrtc/common_audio",
+  "+webrtc/audio_coding/neteq/neteq_unittest.pb.h",  # Different path.
+  "+webrtc/system_wrappers",
+]
diff --git a/webrtc/modules/audio_conference_mixer/DEPS b/webrtc/modules/audio_conference_mixer/DEPS
new file mode 100644
index 0000000..2805958
--- /dev/null
+++ b/webrtc/modules/audio_conference_mixer/DEPS
@@ -0,0 +1,4 @@
+include_rules = [
+  "+webrtc/base",
+  "+webrtc/system_wrappers",
+]
diff --git a/webrtc/modules/audio_device/DEPS b/webrtc/modules/audio_device/DEPS
new file mode 100644
index 0000000..2f4a597
--- /dev/null
+++ b/webrtc/modules/audio_device/DEPS
@@ -0,0 +1,11 @@
+include_rules = [
+  "+webrtc/base",
+  "+webrtc/common_audio",
+  "+webrtc/system_wrappers",
+]
+
+specific_include_rules = {
+  "ensure_initialized\.cc": [
+    "+base/android",
+  ],
+}
diff --git a/webrtc/modules/audio_processing/DEPS b/webrtc/modules/audio_processing/DEPS
new file mode 100644
index 0000000..e9ac967
--- /dev/null
+++ b/webrtc/modules/audio_processing/DEPS
@@ -0,0 +1,14 @@
+include_rules = [
+  "+webrtc/base",
+  "+webrtc/common_audio",
+  "+webrtc/system_wrappers",
+]
+
+specific_include_rules = {
+  ".*test\.cc": [
+    "+webrtc/tools",
+    # Android platform build has different paths.
+    "+gtest",
+    "+external/webrtc",
+  ],
+}
diff --git a/webrtc/modules/audio_processing/agc/agc_unittest.cc b/webrtc/modules/audio_processing/agc/agc_unittest.cc
index 25b99d8..8c6278f 100644
--- a/webrtc/modules/audio_processing/agc/agc_unittest.cc
+++ b/webrtc/modules/audio_processing/agc/agc_unittest.cc
@@ -10,8 +10,8 @@
 
 #include "webrtc/modules/audio_processing/agc/agc.h"
 
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
+#include "testing/gmock/include/gmock/gmock.h"
+#include "testing/gtest/include/gtest/gtest.h"
 
 #include "webrtc/modules/include/module_common_types.h"
 #include "webrtc/test/testsupport/fileutils.h"
diff --git a/webrtc/modules/audio_processing/agc/mock_agc.h b/webrtc/modules/audio_processing/agc/mock_agc.h
index e362200..9e8f64e 100644
--- a/webrtc/modules/audio_processing/agc/mock_agc.h
+++ b/webrtc/modules/audio_processing/agc/mock_agc.h
@@ -13,7 +13,7 @@
 
 #include "webrtc/modules/audio_processing/agc/agc.h"
 
-#include "gmock/gmock.h"
+#include "testing/gmock/include/gmock/gmock.h"
 #include "webrtc/modules/include/module_common_types.h"
 
 namespace webrtc {
diff --git a/webrtc/modules/bitrate_controller/DEPS b/webrtc/modules/bitrate_controller/DEPS
new file mode 100644
index 0000000..9a462b6
--- /dev/null
+++ b/webrtc/modules/bitrate_controller/DEPS
@@ -0,0 +1,5 @@
+include_rules = [
+  "+webrtc/base",
+  "+webrtc/call",
+  "+webrtc/system_wrappers",
+]
diff --git a/webrtc/modules/congestion_controller/DEPS b/webrtc/modules/congestion_controller/DEPS
new file mode 100644
index 0000000..d72e34d
--- /dev/null
+++ b/webrtc/modules/congestion_controller/DEPS
@@ -0,0 +1,5 @@
+include_rules = [
+  "+webrtc/base",
+  "+webrtc/system_wrappers",
+  "+webrtc/video",
+]
diff --git a/webrtc/modules/desktop_capture/DEPS b/webrtc/modules/desktop_capture/DEPS
new file mode 100644
index 0000000..2805958
--- /dev/null
+++ b/webrtc/modules/desktop_capture/DEPS
@@ -0,0 +1,4 @@
+include_rules = [
+  "+webrtc/base",
+  "+webrtc/system_wrappers",
+]
diff --git a/webrtc/modules/include/DEPS b/webrtc/modules/include/DEPS
new file mode 100644
index 0000000..aad6d8a
--- /dev/null
+++ b/webrtc/modules/include/DEPS
@@ -0,0 +1,4 @@
+include_rules = [
+  "+webrtc/base",
+  "+webrtc/common_video",
+]
diff --git a/webrtc/modules/media_file/DEPS b/webrtc/modules/media_file/DEPS
new file mode 100644
index 0000000..5c5452a
--- /dev/null
+++ b/webrtc/modules/media_file/DEPS
@@ -0,0 +1,5 @@
+include_rules = [
+  "+webrtc/base",
+  "+webrtc/common_audio",
+  "+webrtc/system_wrappers",
+]
diff --git a/webrtc/modules/pacing/DEPS b/webrtc/modules/pacing/DEPS
new file mode 100644
index 0000000..2805958
--- /dev/null
+++ b/webrtc/modules/pacing/DEPS
@@ -0,0 +1,4 @@
+include_rules = [
+  "+webrtc/base",
+  "+webrtc/system_wrappers",
+]
diff --git a/webrtc/modules/remote_bitrate_estimator/DEPS b/webrtc/modules/remote_bitrate_estimator/DEPS
new file mode 100644
index 0000000..9a863d9
--- /dev/null
+++ b/webrtc/modules/remote_bitrate_estimator/DEPS
@@ -0,0 +1,10 @@
+include_rules = [
+  "+webrtc/base",
+  "+webrtc/system_wrappers",
+]
+
+specific_include_rules = {
+  "nada\.h": [
+    "+webrtc/voice_engine",
+  ],
+}
diff --git a/webrtc/modules/rtp_rtcp/DEPS b/webrtc/modules/rtp_rtcp/DEPS
new file mode 100644
index 0000000..0720a15
--- /dev/null
+++ b/webrtc/modules/rtp_rtcp/DEPS
@@ -0,0 +1,6 @@
+include_rules = [
+  "+webrtc/base",
+  "+webrtc/call",
+  "+webrtc/common_video",
+  "+webrtc/system_wrappers",
+]
diff --git a/webrtc/modules/utility/DEPS b/webrtc/modules/utility/DEPS
new file mode 100644
index 0000000..1a2885b
--- /dev/null
+++ b/webrtc/modules/utility/DEPS
@@ -0,0 +1,6 @@
+include_rules = [
+  "+webrtc/base",
+  "+webrtc/common_audio",
+  "+webrtc/common_video",
+  "+webrtc/system_wrappers",
+]
diff --git a/webrtc/modules/video_capture/DEPS b/webrtc/modules/video_capture/DEPS
new file mode 100644
index 0000000..58ae9fe
--- /dev/null
+++ b/webrtc/modules/video_capture/DEPS
@@ -0,0 +1,5 @@
+include_rules = [
+  "+webrtc/base",
+  "+webrtc/common_video",
+  "+webrtc/system_wrappers",
+]
diff --git a/webrtc/modules/video_coding/DEPS b/webrtc/modules/video_coding/DEPS
new file mode 100644
index 0000000..512a0d8
--- /dev/null
+++ b/webrtc/modules/video_coding/DEPS
@@ -0,0 +1,9 @@
+include_rules = [
+  "+third_party/ffmpeg",
+  "+third_party/openh264",
+  "+vpx",
+  "+webrtc/base",
+  "+webrtc/common_video",
+  "+webrtc/system_wrappers",
+  "+webrtc/tools",
+]
diff --git a/webrtc/modules/video_coding/codecs/vp8/screenshare_layers_unittest.cc b/webrtc/modules/video_coding/codecs/vp8/screenshare_layers_unittest.cc
index 3117e49..7be4eb1 100644
--- a/webrtc/modules/video_coding/codecs/vp8/screenshare_layers_unittest.cc
+++ b/webrtc/modules/video_coding/codecs/vp8/screenshare_layers_unittest.cc
@@ -11,7 +11,7 @@
 #include <memory>
 #include <vector>
 
-#include "gtest/gtest.h"
+#include "testing/gtest/include/gtest/gtest.h"
 #include "vpx/vpx_encoder.h"
 #include "vpx/vp8cx.h"
 #include "webrtc/modules/video_coding/include/video_codec_interface.h"
diff --git a/webrtc/modules/video_coding/codecs/vp8/simulcast_unittest.h b/webrtc/modules/video_coding/codecs/vp8/simulcast_unittest.h
index 9f0dc5c..2b2aa5d 100644
--- a/webrtc/modules/video_coding/codecs/vp8/simulcast_unittest.h
+++ b/webrtc/modules/video_coding/codecs/vp8/simulcast_unittest.h
@@ -15,6 +15,7 @@
 #include <memory>
 #include <vector>
 
+#include "testing/gtest/include/gtest/gtest.h"
 #include "webrtc/base/checks.h"
 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
 #include "webrtc/modules/video_coding/include/mock/mock_video_codec_interface.h"
@@ -22,8 +23,6 @@
 #include "webrtc/modules/video_coding/codecs/vp8/temporal_layers.h"
 #include "webrtc/video_frame.h"
 
-#include "gtest/gtest.h"
-
 using ::testing::_;
 using ::testing::AllOf;
 using ::testing::Field;
diff --git a/webrtc/modules/video_processing/DEPS b/webrtc/modules/video_processing/DEPS
new file mode 100644
index 0000000..1a2885b
--- /dev/null
+++ b/webrtc/modules/video_processing/DEPS
@@ -0,0 +1,6 @@
+include_rules = [
+  "+webrtc/base",
+  "+webrtc/common_audio",
+  "+webrtc/common_video",
+  "+webrtc/system_wrappers",
+]
diff --git a/webrtc/modules/video_render/DEPS b/webrtc/modules/video_render/DEPS
new file mode 100644
index 0000000..58ae9fe
--- /dev/null
+++ b/webrtc/modules/video_render/DEPS
@@ -0,0 +1,5 @@
+include_rules = [
+  "+webrtc/base",
+  "+webrtc/common_video",
+  "+webrtc/system_wrappers",
+]
diff --git a/webrtc/p2p/DEPS b/webrtc/p2p/DEPS
new file mode 100644
index 0000000..161835f
--- /dev/null
+++ b/webrtc/p2p/DEPS
@@ -0,0 +1,5 @@
+include_rules = [
+  "+net",
+  "+webrtc/base",
+  "+webrtc/system_wrappers",
+]
diff --git a/webrtc/pc/DEPS b/webrtc/pc/DEPS
new file mode 100644
index 0000000..ca4f789
--- /dev/null
+++ b/webrtc/pc/DEPS
@@ -0,0 +1,13 @@
+include_rules = [
+  "+webrtc/api",
+  "+webrtc/base",
+  "+webrtc/media",
+  "+webrtc/p2p",
+  "+third_party/libsrtp"
+]
+
+specific_include_rules = {
+  "srtpfilter_unittest\.cc": [
+    "+crypto",
+  ],
+}
diff --git a/webrtc/sound/DEPS b/webrtc/sound/DEPS
new file mode 100644
index 0000000..7452a9f
--- /dev/null
+++ b/webrtc/sound/DEPS
@@ -0,0 +1,4 @@
+include_rules = [
+  "+webrtc/base",
+]
+
diff --git a/webrtc/system_wrappers/DEPS b/webrtc/system_wrappers/DEPS
new file mode 100644
index 0000000..7452a9f
--- /dev/null
+++ b/webrtc/system_wrappers/DEPS
@@ -0,0 +1,4 @@
+include_rules = [
+  "+webrtc/base",
+]
+
diff --git a/webrtc/test/DEPS b/webrtc/test/DEPS
new file mode 100644
index 0000000..27c0e74
--- /dev/null
+++ b/webrtc/test/DEPS
@@ -0,0 +1,13 @@
+include_rules = [
+  "+webrtc/base",
+  "+webrtc/call",
+  "+webrtc/common_video",
+  "+webrtc/modules/audio_coding",
+  "+webrtc/modules/audio_device",
+  "+webrtc/modules/media_file",
+  "+webrtc/modules/rtp_rtcp",
+  "+webrtc/modules/video_capture",
+  "+webrtc/modules/video_coding",
+  "+webrtc/system_wrappers",
+  "+webrtc/voice_engine",
+]
diff --git a/webrtc/tools/DEPS b/webrtc/tools/DEPS
new file mode 100644
index 0000000..73073f0
--- /dev/null
+++ b/webrtc/tools/DEPS
@@ -0,0 +1,8 @@
+include_rules = [
+  "+webrtc/base",
+  "+webrtc/common_video",
+  "+webrtc/modules/audio_processing",
+  "+webrtc/system_wrappers",
+  "+webrtc/voice_engine",
+]
+
diff --git a/webrtc/video/DEPS b/webrtc/video/DEPS
new file mode 100644
index 0000000..426f47c
--- /dev/null
+++ b/webrtc/video/DEPS
@@ -0,0 +1,17 @@
+include_rules = [
+  "+webrtc/base",
+  "+webrtc/call",
+  "+webrtc/common_video",
+  "+webrtc/modules/bitrate_controller",
+  "+webrtc/modules/congestion_controller",
+  "+webrtc/modules/pacing",
+  "+webrtc/modules/remote_bitrate_estimator",
+  "+webrtc/modules/rtp_rtcp",
+  "+webrtc/modules/utility",
+  "+webrtc/modules/video_coding",
+  "+webrtc/modules/video_capture",
+  "+webrtc/modules/video_processing",
+  "+webrtc/modules/video_render",
+  "+webrtc/system_wrappers",
+  "+webrtc/voice_engine",
+]
diff --git a/webrtc/voice_engine/DEPS b/webrtc/voice_engine/DEPS
new file mode 100644
index 0000000..224eeee
--- /dev/null
+++ b/webrtc/voice_engine/DEPS
@@ -0,0 +1,14 @@
+include_rules = [
+  "+webrtc/base",
+  "+webrtc/call",
+  "+webrtc/common_audio",
+  "+webrtc/modules/audio_coding",
+  "+webrtc/modules/audio_conference_mixer",
+  "+webrtc/modules/audio_device",
+  "+webrtc/modules/audio_processing",
+  "+webrtc/modules/media_file",
+  "+webrtc/modules/pacing",
+  "+webrtc/modules/rtp_rtcp",
+  "+webrtc/modules/utility",
+  "+webrtc/system_wrappers",
+]