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

Side by Side Diff: chrome/renderer/extensions/extension_localization_peer.cc

Issue 2105713002: Render process changes for ResourceTiming sizes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@resource_timing_sizes_browser_process
Patch Set: Created 4 years, 5 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/renderer/extensions/extension_localization_peer.h" 5 #include "chrome/renderer/extensions/extension_localization_peer.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 10 matching lines...) Expand all
21 namespace { 21 namespace {
22 22
23 class StringData final : public content::RequestPeer::ReceivedData { 23 class StringData final : public content::RequestPeer::ReceivedData {
24 public: 24 public:
25 explicit StringData(const std::string& data) : data_(data) {} 25 explicit StringData(const std::string& data) : data_(data) {}
26 void Append(const char* data, int length) { data_.append(data, length); } 26 void Append(const char* data, int length) { data_.append(data, length); }
27 27
28 const char* payload() const override { return data_.data(); } 28 const char* payload() const override { return data_.data(); }
29 int length() const override { return data_.size(); } 29 int length() const override { return data_.size(); }
30 int encoded_length() const override { return -1; } 30 int encoded_length() const override { return -1; }
31 // The original data has substitutions applied, so the original
32 // encoded_body_length no longer applies.
33 int encoded_body_length() const override { return data.size(); }
31 34
32 private: 35 private:
33 std::string data_; 36 std::string data_;
34 37
35 DISALLOW_COPY_AND_ASSIGN(StringData); 38 DISALLOW_COPY_AND_ASSIGN(StringData);
36 }; 39 };
37 40
38 } // namespace 41 } // namespace
39 42
40 ExtensionLocalizationPeer::ExtensionLocalizationPeer( 43 ExtensionLocalizationPeer::ExtensionLocalizationPeer(
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 140
138 l10n_messages = extensions::GetL10nMessagesMap(extension_id); 141 l10n_messages = extensions::GetL10nMessagesMap(extension_id);
139 } 142 }
140 143
141 std::string error; 144 std::string error;
142 if (extensions::MessageBundle::ReplaceMessagesWithExternalDictionary( 145 if (extensions::MessageBundle::ReplaceMessagesWithExternalDictionary(
143 *l10n_messages, &data_, &error)) { 146 *l10n_messages, &data_, &error)) {
144 data_.resize(data_.size()); 147 data_.resize(data_.size());
145 } 148 }
146 } 149 }
OLDNEW
« no previous file with comments | « no previous file | content/child/ftp_directory_listing_response_delegate.cc » ('j') | content/public/child/request_peer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698