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

Side by Side Diff: third_party/WebKit/Source/core/loader/WorkerThreadableLoader.cpp

Issue 2494333002: Replace wrapUnique(new T(args)) by makeUnique<T>(args) in Blink (Closed)
Patch Set: Drop redundant WTF:: Created 4 years, 1 month 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 /* 1 /*
2 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2009, 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 #include "wtf/debug/Alias.h" 46 #include "wtf/debug/Alias.h"
47 #include <memory> 47 #include <memory>
48 48
49 namespace blink { 49 namespace blink {
50 50
51 namespace { 51 namespace {
52 52
53 std::unique_ptr<Vector<char>> createVectorFromMemoryRegion( 53 std::unique_ptr<Vector<char>> createVectorFromMemoryRegion(
54 const char* data, 54 const char* data,
55 unsigned dataLength) { 55 unsigned dataLength) {
56 std::unique_ptr<Vector<char>> buffer = 56 std::unique_ptr<Vector<char>> buffer = makeUnique<Vector<char>>(dataLength);
57 wrapUnique(new Vector<char>(dataLength));
58 memcpy(buffer->data(), data, dataLength); 57 memcpy(buffer->data(), data, dataLength);
59 return buffer; 58 return buffer;
60 } 59 }
61 60
62 } // namespace 61 } // namespace
63 62
64 class WorkerThreadableLoader::AsyncTaskForwarder final 63 class WorkerThreadableLoader::AsyncTaskForwarder final
65 : public WorkerThreadableLoader::TaskForwarder { 64 : public WorkerThreadableLoader::TaskForwarder {
66 public: 65 public:
67 explicit AsyncTaskForwarder(PassRefPtr<WorkerLoaderProxy> loaderProxy) 66 explicit AsyncTaskForwarder(PassRefPtr<WorkerLoaderProxy> loaderProxy)
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 const ResourceLoaderOptions& originalResourceLoaderOptions) { 645 const ResourceLoaderOptions& originalResourceLoaderOptions) {
647 DCHECK(isMainThread()); 646 DCHECK(isMainThread());
648 ResourceLoaderOptions resourceLoaderOptions = originalResourceLoaderOptions; 647 ResourceLoaderOptions resourceLoaderOptions = originalResourceLoaderOptions;
649 resourceLoaderOptions.requestInitiatorContext = WorkerContext; 648 resourceLoaderOptions.requestInitiatorContext = WorkerContext;
650 m_mainThreadLoader = DocumentThreadableLoader::create(document, this, options, 649 m_mainThreadLoader = DocumentThreadableLoader::create(document, this, options,
651 resourceLoaderOptions); 650 resourceLoaderOptions);
652 m_mainThreadLoader->start(ResourceRequest(request.get())); 651 m_mainThreadLoader->start(ResourceRequest(request.get()));
653 } 652 }
654 653
655 } // namespace blink 654 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698