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

Side by Side Diff: chrome/browser/extensions/api/webstore_private/webstore_private_api.cc

Issue 1112573002: [chrome/browser/extensions] Replace MessageLoopProxy usage with ThreadTaskRunnerHandle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolving ng browser unittest issues Created 5 years, 7 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/extensions/api/webstore_private/webstore_private_api.h" 5 #include "chrome/browser/extensions/api/webstore_private/webstore_private_api.h"
6 6
7 #include "base/bind_helpers.h" 7 #include "base/bind_helpers.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 #include "base/message_loop/message_loop_proxy.h"
11 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
12 #include "base/prefs/pref_service.h" 11 #include "base/prefs/pref_service.h"
13 #include "base/strings/stringprintf.h" 12 #include "base/strings/stringprintf.h"
13 #include "base/thread_task_runner_handle.h"
14 #include "base/values.h" 14 #include "base/values.h"
15 #include "base/version.h" 15 #include "base/version.h"
16 #include "chrome/browser/apps/ephemeral_app_launcher.h" 16 #include "chrome/browser/apps/ephemeral_app_launcher.h"
17 #include "chrome/browser/bitmap_fetcher/bitmap_fetcher.h" 17 #include "chrome/browser/bitmap_fetcher/bitmap_fetcher.h"
18 #include "chrome/browser/extensions/crx_installer.h" 18 #include "chrome/browser/extensions/crx_installer.h"
19 #include "chrome/browser/extensions/extension_install_ui_util.h" 19 #include "chrome/browser/extensions/extension_install_ui_util.h"
20 #include "chrome/browser/extensions/extension_service.h" 20 #include "chrome/browser/extensions/extension_service.h"
21 #include "chrome/browser/extensions/install_tracker.h" 21 #include "chrome/browser/extensions/install_tracker.h"
22 #include "chrome/browser/gpu/gpu_feature_checker.h" 22 #include "chrome/browser/gpu/gpu_feature_checker.h"
23 #include "chrome/browser/profiles/profile.h" 23 #include "chrome/browser/profiles/profile.h"
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
614 if (!icon_url.is_valid()) 614 if (!icon_url.is_valid())
615 return RespondNow(Error(kInvalidIconUrlError)); 615 return RespondNow(Error(kInvalidIconUrlError));
616 616
617 // The bitmap fetcher will call us back via OnFetchComplete. 617 // The bitmap fetcher will call us back via OnFetchComplete.
618 icon_fetcher_.reset(new chrome::BitmapFetcher(icon_url, this)); 618 icon_fetcher_.reset(new chrome::BitmapFetcher(icon_url, this));
619 icon_fetcher_->Start( 619 icon_fetcher_->Start(
620 browser_context()->GetRequestContext(), std::string(), 620 browser_context()->GetRequestContext(), std::string(),
621 net::URLRequest::CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE, 621 net::URLRequest::CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE,
622 net::LOAD_DO_NOT_SAVE_COOKIES | net::LOAD_DO_NOT_SEND_COOKIES); 622 net::LOAD_DO_NOT_SAVE_COOKIES | net::LOAD_DO_NOT_SEND_COOKIES);
623 } else { 623 } else {
624 base::MessageLoopProxy::current()->PostTask( 624 base::ThreadTaskRunnerHandle::Get()->PostTask(
625 FROM_HERE, 625 FROM_HERE,
626 base::Bind(&WebstorePrivateInstallBundleFunction::OnFetchComplete, 626 base::Bind(&WebstorePrivateInstallBundleFunction::OnFetchComplete,
627 this, GURL(), nullptr)); 627 this, GURL(), nullptr));
628 } 628 }
629 629
630 AddRef(); // Balanced in OnFetchComplete. 630 AddRef(); // Balanced in OnFetchComplete.
631 631
632 // The response is sent asynchronously in OnFetchComplete, OnInstallApproval, 632 // The response is sent asynchronously in OnFetchComplete, OnInstallApproval,
633 // or OnInstallComplete. 633 // or OnInstallComplete.
634 return RespondLater(); 634 return RespondLater();
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 WebstorePrivateGetEphemeralAppsEnabledFunction:: 869 WebstorePrivateGetEphemeralAppsEnabledFunction::
870 ~WebstorePrivateGetEphemeralAppsEnabledFunction() {} 870 ~WebstorePrivateGetEphemeralAppsEnabledFunction() {}
871 871
872 ExtensionFunction::ResponseAction 872 ExtensionFunction::ResponseAction
873 WebstorePrivateGetEphemeralAppsEnabledFunction::Run() { 873 WebstorePrivateGetEphemeralAppsEnabledFunction::Run() {
874 return RespondNow(ArgumentList(GetEphemeralAppsEnabled::Results::Create( 874 return RespondNow(ArgumentList(GetEphemeralAppsEnabled::Results::Create(
875 EphemeralAppLauncher::IsFeatureEnabled()))); 875 EphemeralAppLauncher::IsFeatureEnabled())));
876 } 876 }
877 877
878 } // namespace extensions 878 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/web_request/web_request_api_unittest.cc ('k') | chrome/browser/extensions/blacklist.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698