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

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

Issue 138803012: Fix use-after-free in WebstoreInstaller (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/extensions/bundle_installer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/command_line.h" 8 #include "base/command_line.h"
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/memory/scoped_vector.h" 10 #include "base/memory/scoped_vector.h"
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 item.manifest = params.details[i]->manifest; 233 item.manifest = params.details[i]->manifest;
234 item.localized_name = params.details[i]->localized_name; 234 item.localized_name = params.details[i]->localized_name;
235 items->push_back(item); 235 items->push_back(item);
236 } 236 }
237 237
238 return true; 238 return true;
239 } 239 }
240 240
241 void WebstorePrivateInstallBundleFunction::OnBundleInstallApproved() { 241 void WebstorePrivateInstallBundleFunction::OnBundleInstallApproved() {
242 bundle_->CompleteInstall( 242 bundle_->CompleteInstall(
243 &(dispatcher()->delegate()->GetAssociatedWebContents()->GetController()), 243 dispatcher()->delegate()->GetAssociatedWebContents(),
244 this); 244 this);
245 } 245 }
246 246
247 void WebstorePrivateInstallBundleFunction::OnBundleInstallCanceled( 247 void WebstorePrivateInstallBundleFunction::OnBundleInstallCanceled(
248 bool user_initiated) { 248 bool user_initiated) {
249 if (user_initiated) 249 if (user_initiated)
250 error_ = "user_canceled"; 250 error_ = "user_canceled";
251 else 251 else
252 error_ = "unknown_error"; 252 error_ = "unknown_error";
253 253
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 app_list_service->CreateForProfile(GetProfile()); 563 app_list_service->CreateForProfile(GetProfile());
564 else 564 else
565 app_list_service->ShowForProfile(GetProfile()); 565 app_list_service->ShowForProfile(GetProfile());
566 } 566 }
567 567
568 // The extension will install through the normal extension install flow, but 568 // The extension will install through the normal extension install flow, but
569 // the whitelist entry will bypass the normal permissions install dialog. 569 // the whitelist entry will bypass the normal permissions install dialog.
570 scoped_refptr<WebstoreInstaller> installer = new WebstoreInstaller( 570 scoped_refptr<WebstoreInstaller> installer = new WebstoreInstaller(
571 GetProfile(), 571 GetProfile(),
572 this, 572 this,
573 &(dispatcher()->delegate()->GetAssociatedWebContents()->GetController()), 573 dispatcher()->delegate()->GetAssociatedWebContents(),
574 params->expected_id, 574 params->expected_id,
575 approval_.Pass(), 575 approval_.Pass(),
576 WebstoreInstaller::INSTALL_SOURCE_OTHER); 576 WebstoreInstaller::INSTALL_SOURCE_OTHER);
577 installer->Start(); 577 installer->Start();
578 578
579 return true; 579 return true;
580 } 580 }
581 581
582 void WebstorePrivateCompleteInstallFunction::OnExtensionInstallSuccess( 582 void WebstorePrivateCompleteInstallFunction::OnExtensionInstallSuccess(
583 const std::string& id) { 583 const std::string& id) {
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 return true; 678 return true;
679 } 679 }
680 680
681 bool WebstorePrivateIsInIncognitoModeFunction::RunImpl() { 681 bool WebstorePrivateIsInIncognitoModeFunction::RunImpl() {
682 results_ = IsInIncognitoMode::Results::Create( 682 results_ = IsInIncognitoMode::Results::Create(
683 GetProfile() != GetProfile()->GetOriginalProfile()); 683 GetProfile() != GetProfile()->GetOriginalProfile());
684 return true; 684 return true;
685 } 685 }
686 686
687 } // namespace extensions 687 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/bundle_installer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698