| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/html_viewer/blink_platform_impl.h" | 5 #include "components/html_viewer/blink_platform_impl.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/rand_util.h" | 10 #include "base/rand_util.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 | 70 |
| 71 BlinkPlatformImpl::BlinkPlatformImpl( | 71 BlinkPlatformImpl::BlinkPlatformImpl( |
| 72 GlobalState* global_state, | 72 GlobalState* global_state, |
| 73 mojo::ApplicationImpl* app, | 73 mojo::ApplicationImpl* app, |
| 74 scheduler::RendererScheduler* renderer_scheduler) | 74 scheduler::RendererScheduler* renderer_scheduler) |
| 75 : global_state_(global_state), | 75 : global_state_(global_state), |
| 76 app_(app), | 76 app_(app), |
| 77 main_thread_task_runner_(renderer_scheduler->DefaultTaskRunner()), | 77 main_thread_task_runner_(renderer_scheduler->DefaultTaskRunner()), |
| 78 main_thread_(renderer_scheduler->CreateMainThread()) { | 78 main_thread_(renderer_scheduler->CreateMainThread()) { |
| 79 if (app) { | 79 if (app) { |
| 80 mojo::URLRequestPtr request(mojo::URLRequest::New()); | |
| 81 request->url = mojo::String::From("mojo:network_service"); | |
| 82 scoped_ptr<mojo::ApplicationConnection> connection = | 80 scoped_ptr<mojo::ApplicationConnection> connection = |
| 83 app->ConnectToApplication(request.Pass()); | 81 app->ConnectToApplication("mojo:network_service"); |
| 84 connection->ConnectToService(&web_socket_factory_); | 82 connection->ConnectToService(&web_socket_factory_); |
| 85 connection->ConnectToService(&url_loader_factory_); | 83 connection->ConnectToService(&url_loader_factory_); |
| 86 | 84 |
| 87 mojo::CookieStorePtr cookie_store; | 85 mojo::CookieStorePtr cookie_store; |
| 88 connection->ConnectToService(&cookie_store); | 86 connection->ConnectToService(&cookie_store); |
| 89 cookie_jar_.reset(new WebCookieJarImpl(cookie_store.Pass())); | 87 cookie_jar_.reset(new WebCookieJarImpl(cookie_store.Pass())); |
| 90 | 88 |
| 91 mojo::ClipboardPtr clipboard; | 89 mojo::ClipboardPtr clipboard; |
| 92 mojo::URLRequestPtr request2(mojo::URLRequest::New()); | 90 app->ConnectToService("mojo:clipboard", &clipboard); |
| 93 request2->url = mojo::String::From("mojo:clipboard"); | |
| 94 app->ConnectToService(request2.Pass(), &clipboard); | |
| 95 clipboard_.reset(new WebClipboardImpl(clipboard.Pass())); | 91 clipboard_.reset(new WebClipboardImpl(clipboard.Pass())); |
| 96 } | 92 } |
| 97 } | 93 } |
| 98 | 94 |
| 99 BlinkPlatformImpl::~BlinkPlatformImpl() { | 95 BlinkPlatformImpl::~BlinkPlatformImpl() { |
| 100 } | 96 } |
| 101 | 97 |
| 102 blink::WebCookieJar* BlinkPlatformImpl::cookieJar() { | 98 blink::WebCookieJar* BlinkPlatformImpl::cookieJar() { |
| 103 return cookie_jar_.get(); | 99 return cookie_jar_.get(); |
| 104 } | 100 } |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 BlinkPlatformImpl::notificationManager() { | 311 BlinkPlatformImpl::notificationManager() { |
| 316 return &web_notification_manager_; | 312 return &web_notification_manager_; |
| 317 } | 313 } |
| 318 | 314 |
| 319 void BlinkPlatformImpl::UpdateWebThreadTLS(blink::WebThread* thread) { | 315 void BlinkPlatformImpl::UpdateWebThreadTLS(blink::WebThread* thread) { |
| 320 DCHECK(!current_thread_slot_.Get()); | 316 DCHECK(!current_thread_slot_.Get()); |
| 321 current_thread_slot_.Set(thread); | 317 current_thread_slot_.Set(thread); |
| 322 } | 318 } |
| 323 | 319 |
| 324 } // namespace html_viewer | 320 } // namespace html_viewer |
| OLD | NEW |