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

Unified Diff: content/browser/service_worker/foreign_fetch_request_handler.cc

Issue 2815913005: Switch to using scoped_ptr with UserData (Closed)
Patch Set: fixes Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/service_worker/foreign_fetch_request_handler.cc
diff --git a/content/browser/service_worker/foreign_fetch_request_handler.cc b/content/browser/service_worker/foreign_fetch_request_handler.cc
index 8c3aab421ac2b0d2718ea224f632fb42f703a4b2..5005b3e93352fc0a9d3fe886e1696960df5d3a6a 100644
--- a/content/browser/service_worker/foreign_fetch_request_handler.cc
+++ b/content/browser/service_worker/foreign_fetch_request_handler.cc
@@ -5,9 +5,11 @@
#include "content/browser/service_worker/foreign_fetch_request_handler.h"
#include <string>
+#include <utility>
#include "base/command_line.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/stl_util.h"
#include "content/browser/service_worker/service_worker_context_wrapper.h"
#include "content/browser/service_worker/service_worker_response_info.h"
@@ -124,12 +126,12 @@ void ForeignFetchRequestHandler::InitializeHandler(
// Any more precise checks to see if the request should be intercepted are
// asynchronous, so just create our handler in all cases.
- std::unique_ptr<ForeignFetchRequestHandler> handler(
- new ForeignFetchRequestHandler(
+ std::unique_ptr<ForeignFetchRequestHandler> handler =
+ base::WrapUnique(new ForeignFetchRequestHandler(
context_wrapper, blob_storage_context->AsWeakPtr(), request_mode,
credentials_mode, redirect_mode, resource_type, request_context_type,
frame_type, body, timeout));
- request->SetUserData(&kUserDataKey, handler.release());
+ request->SetUserData(&kUserDataKey, std::move(handler));
}
ForeignFetchRequestHandler* ForeignFetchRequestHandler::GetHandler(

Powered by Google App Engine
This is Rietveld 408576698