| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/shell/shell_browser_main_parts.h" | 5 #include "content/shell/shell_browser_main_parts.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 } | 58 } |
| 59 | 59 |
| 60 void ShellBrowserMainParts::PreEarlyInitialization() { | 60 void ShellBrowserMainParts::PreEarlyInitialization() { |
| 61 #if defined(OS_ANDROID) | 61 #if defined(OS_ANDROID) |
| 62 net::NetworkChangeNotifier::SetFactory( | 62 net::NetworkChangeNotifier::SetFactory( |
| 63 new net::android::NetworkChangeNotifierFactory()); | 63 new net::android::NetworkChangeNotifierFactory()); |
| 64 #endif | 64 #endif |
| 65 } | 65 } |
| 66 | 66 |
| 67 void ShellBrowserMainParts::PreMainMessageLoopRun() { | 67 void ShellBrowserMainParts::PreMainMessageLoopRun() { |
| 68 browser_context_.reset(new ShellBrowserContext); | 68 browser_context_.reset(new ShellBrowserContext(false)); |
| 69 off_the_record_browser_context_.reset(new ShellBrowserContext(true)); |
| 69 | 70 |
| 70 Shell::PlatformInitialize(); | 71 Shell::PlatformInitialize(); |
| 71 net::NetModule::SetResourceProvider(Shell::PlatformResourceProvider); | 72 net::NetModule::SetResourceProvider(Shell::PlatformResourceProvider); |
| 72 | 73 |
| 73 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 74 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 74 if (command_line.HasSwitch(switches::kRemoteDebuggingPort)) { | 75 if (command_line.HasSwitch(switches::kRemoteDebuggingPort)) { |
| 75 std::string port_str = | 76 std::string port_str = |
| 76 command_line.GetSwitchValueASCII(switches::kRemoteDebuggingPort); | 77 command_line.GetSwitchValueASCII(switches::kRemoteDebuggingPort); |
| 77 int port; | 78 int port; |
| 78 if (base::StringToInt(port_str, &port) && port > 0 && port < 65535) { | 79 if (base::StringToInt(port_str, &port) && port > 0 && port < 65535) { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 100 } | 101 } |
| 101 | 102 |
| 102 bool ShellBrowserMainParts::MainMessageLoopRun(int* result_code) { | 103 bool ShellBrowserMainParts::MainMessageLoopRun(int* result_code) { |
| 103 return !run_message_loop_; | 104 return !run_message_loop_; |
| 104 } | 105 } |
| 105 | 106 |
| 106 void ShellBrowserMainParts::PostMainMessageLoopRun() { | 107 void ShellBrowserMainParts::PostMainMessageLoopRun() { |
| 107 if (devtools_delegate_) | 108 if (devtools_delegate_) |
| 108 devtools_delegate_->Stop(); | 109 devtools_delegate_->Stop(); |
| 109 browser_context_.reset(); | 110 browser_context_.reset(); |
| 111 off_the_record_browser_context_.reset(); |
| 110 } | 112 } |
| 111 | 113 |
| 112 } // namespace | 114 } // namespace |
| OLD | NEW |