Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(500)

Side by Side Diff: chrome/browser/pepper_flash_settings_manager.cc

Issue 1184523003: attachment broker wip (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minor comments. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "chrome/browser/pepper_flash_settings_manager.h" 5 #include "chrome/browser/pepper_flash_settings_manager.h"
6 6
7 #include <map> 7 #include <map>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
13 #include "base/files/file_util.h" 13 #include "base/files/file_util.h"
14 #include "base/prefs/pref_service.h" 14 #include "base/prefs/pref_service.h"
15 #include "base/sequenced_task_runner_helpers.h" 15 #include "base/sequenced_task_runner_helpers.h"
16 #include "base/strings/utf_string_conversions.h" 16 #include "base/strings/utf_string_conversions.h"
17 #include "chrome/browser/plugins/plugin_prefs.h" 17 #include "chrome/browser/plugins/plugin_prefs.h"
18 #include "chrome/browser/profiles/profile.h" 18 #include "chrome/browser/profiles/profile.h"
19 #include "chrome/browser/renderer_host/pepper/device_id_fetcher.h" 19 #include "chrome/browser/renderer_host/pepper/device_id_fetcher.h"
20 #include "chrome/common/pref_names.h" 20 #include "chrome/common/pref_names.h"
21 #include "components/pref_registry/pref_registry_syncable.h" 21 #include "components/pref_registry/pref_registry_syncable.h"
22 #include "content/public/browser/browser_context.h" 22 #include "content/public/browser/browser_context.h"
23 #include "content/public/browser/browser_thread.h" 23 #include "content/public/browser/browser_thread.h"
24 #include "content/public/browser/pepper_flash_settings_helper.h" 24 #include "content/public/browser/pepper_flash_settings_helper.h"
25 #include "content/public/browser/plugin_service.h" 25 #include "content/public/browser/plugin_service.h"
26 #include "content/public/common/child_process_host.h"
26 #include "content/public/common/content_constants.h" 27 #include "content/public/common/content_constants.h"
27 #include "content/public/common/webplugininfo.h" 28 #include "content/public/common/webplugininfo.h"
28 #include "ipc/ipc_channel.h" 29 #include "ipc/ipc_channel.h"
29 #include "ipc/ipc_listener.h" 30 #include "ipc/ipc_listener.h"
30 #include "ppapi/proxy/ppapi_messages.h" 31 #include "ppapi/proxy/ppapi_messages.h"
31 #include "url/gurl.h" 32 #include "url/gurl.h"
32 33
33 using content::BrowserThread; 34 using content::BrowserThread;
34 35
35 class PepperFlashSettingsManager::Core 36 class PepperFlashSettingsManager::Core
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 347
347 DCHECK(state_ == STATE_UNINITIALIZED); 348 DCHECK(state_ == STATE_UNINITIALIZED);
348 DCHECK(!channel_.get()); 349 DCHECK(!channel_.get());
349 350
350 if (!success) { 351 if (!success) {
351 DLOG(ERROR) << "Couldn't open plugin channel"; 352 DLOG(ERROR) << "Couldn't open plugin channel";
352 NotifyErrorFromIOThread(); 353 NotifyErrorFromIOThread();
353 return; 354 return;
354 } 355 }
355 356
356 channel_ = IPC::Channel::CreateClient(handle, this); 357 channel_ = IPC::Channel::CreateClient(
358 handle, this, content::ChildProcessHost::GetAttachmentBroker());
357 if (!channel_->Connect()) { 359 if (!channel_->Connect()) {
358 DLOG(ERROR) << "Couldn't connect to plugin"; 360 DLOG(ERROR) << "Couldn't connect to plugin";
359 NotifyErrorFromIOThread(); 361 NotifyErrorFromIOThread();
360 return; 362 return;
361 } 363 }
362 364
363 state_ = STATE_INITIALIZED; 365 state_ = STATE_INITIALIZED;
364 366
365 std::vector<PendingRequest> temp_pending_requests; 367 std::vector<PendingRequest> temp_pending_requests;
366 temp_pending_requests.swap(pending_requests_); 368 temp_pending_requests.swap(pending_requests_);
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
1056 } 1058 }
1057 1059
1058 void PepperFlashSettingsManager::OnError(Core* core) { 1060 void PepperFlashSettingsManager::OnError(Core* core) {
1059 DCHECK(core); 1061 DCHECK(core);
1060 if (core != core_.get()) 1062 if (core != core_.get())
1061 return; 1063 return;
1062 1064
1063 core_->Detach(); 1065 core_->Detach();
1064 core_ = NULL; 1066 core_ = NULL;
1065 } 1067 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698