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

Side by Side Diff: content/browser/service_worker/service_worker_browsertest.cc

Issue 691413002: Removing redundant 'is_null' field in ServiceWorkerVersionInfo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_info.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/callback.h" 6 #include "base/callback.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "content/browser/fileapi/chrome_blob_storage_context.h" 10 #include "content/browser/fileapi/chrome_blob_storage_context.h"
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 int* num_resources) { 235 int* num_resources) {
236 *num_resources = -1; 236 *num_resources = -1;
237 237
238 std::vector<ServiceWorkerRegistrationInfo> infos = 238 std::vector<ServiceWorkerRegistrationInfo> infos =
239 wrapper->context()->GetAllLiveRegistrationInfo(); 239 wrapper->context()->GetAllLiveRegistrationInfo();
240 if (infos.empty()) 240 if (infos.empty())
241 return; 241 return;
242 242
243 int version_id; 243 int version_id;
244 size_t index = infos.size() - 1; 244 size_t index = infos.size() - 1;
245 if (!infos[index].installing_version.is_null) 245 if (infos[index].installing_version.version_id !=
246 kInvalidServiceWorkerVersionId)
246 version_id = infos[index].installing_version.version_id; 247 version_id = infos[index].installing_version.version_id;
247 else if (!infos[index].waiting_version.is_null) 248 else if (infos[index].waiting_version.version_id !=
249 kInvalidServiceWorkerVersionId)
248 version_id = infos[1].waiting_version.version_id; 250 version_id = infos[1].waiting_version.version_id;
249 else if (!infos[index].active_version.is_null) 251 else if (infos[index].active_version.version_id !=
252 kInvalidServiceWorkerVersionId)
250 version_id = infos[index].active_version.version_id; 253 version_id = infos[index].active_version.version_id;
251 else 254 else
252 return; 255 return;
253 256
254 ServiceWorkerVersion* version = 257 ServiceWorkerVersion* version =
255 wrapper->context()->GetLiveVersion(version_id); 258 wrapper->context()->GetLiveVersion(version_id);
256 *num_resources = static_cast<int>(version->script_cache_map()->size()); 259 *num_resources = static_cast<int>(version->script_cache_map()->size());
257 } 260 }
258 261
259 } // namespace 262 } // namespace
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after
938 RunOnIOThread( 941 RunOnIOThread(
939 base::Bind(&ServiceWorkerBlackBoxBrowserTest::FindRegistrationOnIO, 942 base::Bind(&ServiceWorkerBlackBoxBrowserTest::FindRegistrationOnIO,
940 this, 943 this,
941 embedded_test_server()->GetURL("/service_worker/empty.html"), 944 embedded_test_server()->GetURL("/service_worker/empty.html"),
942 &status)); 945 &status));
943 EXPECT_EQ(SERVICE_WORKER_ERROR_NOT_FOUND, status); 946 EXPECT_EQ(SERVICE_WORKER_ERROR_NOT_FOUND, status);
944 } 947 }
945 } 948 }
946 949
947 } // namespace content 950 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/service_worker/service_worker_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698